; ModuleID = 'send_row.ll'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i386-pc-linux-gnu"

%struct.MPI_Status = type { i32, i32, i32, i32, i32 }
%struct.ompi_communicator_t = type opaque
%struct.ompi_datatype_t = type opaque
%struct.ompi_predefined_communicator_t = type opaque
%struct.ompi_predefined_datatype_t = type opaque

@ompi_mpi_comm_world = external global %struct.ompi_predefined_communicator_t
@ompi_mpi_float = external global %struct.ompi_predefined_datatype_t
@.str = private constant [7 x i8] c"%3.1f \00", align 1

define i32 @main(i32 %argc, i8** %argv) nounwind {
entry:
  %argc_addr = alloca i32, align 4
  %argv_addr = alloca i8**, align 4
  %my_rank = alloca i32
  %A = alloca [10 x [10 x float]]
  %status = alloca %struct.MPI_Status
  %"alloca point" = bitcast i32 0 to i32
  store i32 %argc, i32* %argc_addr
  store i8** %argv, i8*** %argv_addr
  %0 = call i32 @MPI_Init(i32* %argc_addr, i8*** %argv_addr) nounwind
  %1 = call i32 @MPI_Comm_rank(%struct.ompi_communicator_t* bitcast (%struct.ompi_predefined_communicator_t* @ompi_mpi_comm_world to %struct.ompi_communicator_t*), i32* %my_rank) nounwind
  %2 = load i32* %my_rank, align 4
  %3 = icmp eq i32 %2, 0
  br i1 %3, label %bb, label %bb7

bb:                                               ; preds = %entry
  br label %bb5

bb1:                                              ; preds = %bb5
  br label %bb3

bb2:                                              ; preds = %bb3
  %4 = sitofp i32 %i.0 to float
  %5 = getelementptr inbounds [10 x [10 x float]]* %A, i32 0, i32 %i.0
  %6 = getelementptr inbounds [10 x float]* %5, i32 0, i32 %j.0
  store float %4, float* %6, align 4
  %7 = add nsw i32 %j.0, 1
  br label %bb3

bb3:                                              ; preds = %bb2, %bb1
  %j.0 = phi i32 [ 0, %bb1 ], [ %7, %bb2 ]
  %8 = icmp sle i32 %j.0, 9
  br i1 %8, label %bb2, label %bb4

bb4:                                              ; preds = %bb3
  %9 = add nsw i32 %i.0, 1
  br label %bb5

bb5:                                              ; preds = %bb4, %bb
  %i.0 = phi i32 [ 0, %bb ], [ %9, %bb4 ]
  %10 = icmp sle i32 %i.0, 9
  br i1 %10, label %bb1, label %bb6

bb6:                                              ; preds = %bb5
  %11 = getelementptr inbounds [10 x [10 x float]]* %A, i32 0, i32 2
  %12 = getelementptr inbounds [10 x float]* %11, i32 0, i32 0
  %13 = bitcast float* %12 to i8*
  %14 = call i32 @MPI_Send(i8* %13, i32 10, %struct.ompi_datatype_t* bitcast (%struct.ompi_predefined_datatype_t* @ompi_mpi_float to %struct.ompi_datatype_t*), i32 1, i32 0, %struct.ompi_communicator_t* bitcast (%struct.ompi_predefined_communicator_t* @ompi_mpi_comm_world to %struct.ompi_communicator_t*)) nounwind
  br label %bb11

bb7:                                              ; preds = %entry
  %15 = getelementptr inbounds [10 x [10 x float]]* %A, i32 0, i32 2
  %16 = getelementptr inbounds [10 x float]* %15, i32 0, i32 0
  %17 = bitcast float* %16 to i8*
  %18 = call i32 @MPI_Recv(i8* %17, i32 10, %struct.ompi_datatype_t* bitcast (%struct.ompi_predefined_datatype_t* @ompi_mpi_float to %struct.ompi_datatype_t*), i32 0, i32 0, %struct.ompi_communicator_t* bitcast (%struct.ompi_predefined_communicator_t* @ompi_mpi_comm_world to %struct.ompi_communicator_t*), %struct.MPI_Status* %status) nounwind
  br label %bb9

bb8:                                              ; preds = %bb9
  %19 = getelementptr inbounds [10 x [10 x float]]* %A, i32 0, i32 2
  %20 = getelementptr inbounds [10 x float]* %19, i32 0, i32 %j.1
  %21 = load float* %20, align 4
  %22 = fpext float %21 to double
  %23 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([7 x i8]* @.str, i32 0, i32 0), double %22) nounwind
  %24 = add nsw i32 %j.1, 1
  br label %bb9

bb9:                                              ; preds = %bb8, %bb7
  %j.1 = phi i32 [ 0, %bb7 ], [ %24, %bb8 ]
  %25 = icmp sle i32 %j.1, 9
  br i1 %25, label %bb8, label %bb10

bb10:                                             ; preds = %bb9
  %26 = call i32 @putchar(i32 10) nounwind
  br label %bb11

bb11:                                             ; preds = %bb10, %bb6
  %27 = call i32 @MPI_Finalize() nounwind
  br label %return

return:                                           ; preds = %bb11
  ret i32 undef
}

declare i32 @MPI_Init(i32*, i8***)

declare i32 @MPI_Comm_rank(%struct.ompi_communicator_t*, i32*)

declare i32 @MPI_Send(i8*, i32, %struct.ompi_datatype_t*, i32, i32, %struct.ompi_communicator_t*)

declare i32 @MPI_Recv(i8*, i32, %struct.ompi_datatype_t*, i32, i32, %struct.ompi_communicator_t*, %struct.MPI_Status*)

declare i32 @printf(i8* noalias, ...) nounwind

declare i32 @putchar(i32)

declare i32 @MPI_Finalize()
